package cn.sprhib.model;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("controller")
public class UsersController{

	@Resource
	private UsersDao usersDaoImpl;
	public UsersDao getUsersDaoImpl() {
		return usersDaoImpl;
	}
	public void setUsersDaoImpl(UsersDao usersDaoImpl) {
		this.usersDaoImpl = usersDaoImpl;
	}



	@RequestMapping(value="/addUser.action",method=RequestMethod.GET)
	public void addUsers(HttpServletRequest request,HttpServletResponse response){
		String username = request.getParameter("username");
		String password = request.getParameter("password");
		Users u = new Users();
		u.setUsername(username);
		u.setPassword(password);
		usersDaoImpl.addUser(u);
		
	}
	
	
}
